﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

    class ExtractSentence
    {
        static int CountKeyword(string text, string keyword)
        {
            int count = 0;
            text = text.ToLower();
            while (text.IndexOf(keyword) != -1)
            {
                int index = text.LastIndexOf(keyword);
                if (text.Substring(index, keyword.Length) != "")
                {
                    count++;
                    text = text.Remove(index);
                }
            }
            return count;
        }
        static void Main(string[] args)
        {
            string text =   "We are living in an yellow submarine." +
                            "We don't have anything else. Inside the submarine is very tight." +
                            "So we are drinking all the day. We will move out of it in 5 days.";
            string keyword = " in ";
            string[] sentences = text.Split('.');
            
            for (int i = 0; i < sentences.Length; i++)
            {
               if(CountKeyword(sentences[i],keyword)>0)
                {
                    Console.WriteLine((sentences[i]+".").Trim());
                }
            }
        }
    }

